import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import xwbridge from './driver/xwebview/xwebview-bridge.js';
import xwunibridge from './driver/xwebview/xwebview-unibridge.js';
import http from './service/http.js';
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);
import {recoverScroll} from './mixins'
Vue.mixin(recoverScroll)


// 移动调试控制台
import eruda from 'eruda'; 
eruda.init();


Vue.config.productionTip = false
Vue.prototype.$http = http;

let vueApp = new Vue({
  router,
  store,
  render: h => h(App)
});
const xwv = sessionStorage.getItem('xw_v');
if(window.location.search.includes('xw_v') || xwv){
	if(!xwv){
		sessionStorage.setItem('xw_v',1)
	}
	xwbridge.ready((e)=>{
		// 将兼容uniapp api的兼容对象赋值给window(简化uniapp调用)
		xwbridge.installPlugins(xwunibridge);
		window.uni = xwunibridge;
		// 设置vue渲染页面
		vueApp.$mount('#app')
	});
}else{
	vueApp.$mount('#app')
}


